"""任务添加页面"""
from selenium.webdriver.common.by import By
from page.base_page import BasePage
class AddTaskPage(BasePage):
    """数据准备"""
    url = "/index.php?m=task&a=add"
    theme_locator = (By.NAME, "subject")
    person_in_charge_locator = (By.ID, "owner_name")
    btn_person_locator = (By.XPATH, "/html/body/div[7]/div[2]/form/div[1]/span[1]/input")
    click_ok_locator = (By.CSS_SELECTOR, "body > div:nth-child(12) > div.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix > div > button:nth-child(1) > span")
    click_save_locator = (By.CSS_SELECTOR,"body > div.container > div.row-fluid > div > form > table > tfoot > tr > td:nth-child(2) > input:nth-child(1)")

    def theme(self, content):
        """编辑主题"""
        self.send_keys(self.theme_locator,content)
    def person_in_charge(self):
        """点击负责人"""
        self.click(self.person_in_charge_locator)
    def btn_one_person(self):
        """选择第一个负责人"""
        self.click(self.btn_person_locator)
    def click_ok(self):
        """点击ok"""
        self.click(self.click_ok_locator)
    def click_save(self):
        """点击今日应收"""
        self.click(self.click_save_locator)





